<?php

namespace app\index\service;

use EasyWeChat\Factory;

class Token
{
    //验证token操作
    function checkToken(){
        $config = [
            'app_id' => config('ofcl.app_id'),
            'secret' => config('ofcl.app_secret'),

            'response_type' => 'array',

            'log' => [
                'level' => 'debug',
                'file' => config('ofcl.log_path').'token_log',
            ],
        ];

        $app = Factory::officialAccount($config);
        $response = $app->server->serve();
        // 将响应输出
        $response->send(); // Laravel 里请使用：return $response;
    }
}